// formSchema.ts
export const formSchema = [
  {
    field: "username",
    label: "用户名",
    type: "input",
    placeholder: "请输入用户名",
    rules: [{ required: true, message: "用户名不能为空", trigger: "blur" }],
    style: { width: "300px" },
  },
  {
    field: "gender",
    label: "性别",
    type: "radio",
    options: [
      { label: "男", value: "male" },
      { label: "女", value: "female" },
    ],
  },
  {
    field: "hobbies",
    label: "兴趣爱好",
    type: "checkbox",
    options: [
      { label: "足球", value: "football" },
      { label: "篮球", value: "basketball" },
      { label: "音乐", value: "music" },
    ],
  },
  {
    field: "birthday",
    label: "生日",
    type: "date",
    placeholder: "请选择日期",
    rules: [{ required: true, message: "请选择生日", trigger: "change" }],
  },
  {
    field: "avatar",
    label: "头像",
    type: "upload",
    action: "/api/upload", // 上传地址
    limit: 1,
    rules: [{ required: true, message: "请上传头像", trigger: "change" }],
  },
  {
    field: "description",
    label: "简介",
    type: "text",
    text: "这是一个静态展示字段",
  },
  {
    field: "customSlot",
    label: "自定义插槽",
    type: "slot",
    slotName: "extraField",
  },
];
